package com.spring.quickstart.controller.demo;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class TempletAction {

	//http://127.0.0.1:8080/demo/dynamicParseTemplet.htm?tempId=1001&userName=xiongxin
	@RequestMapping("/demo/dynamicParseTemplet.htm")
	public void dynamicParseTemplet(HttpServletRequest request, ModelMap model, @RequestParam("tempId") String tempId, @RequestParam("userName") String userName) throws Exception {
		model.addAttribute("tempId", tempId);
		model.addAttribute("userName", userName);
	}

	//http://127.0.0.1:8080/demo/temp/loadIframe.htm?tempId=1001&userName=xiongxin
	@RequestMapping("/demo/temp/loadIframe.htm")
	public void loadIframe(HttpServletRequest request, ModelMap model, @RequestParam("tempId") String tempId, @RequestParam("userName") String userName) throws Exception {
		model.addAttribute("tempId", tempId);
		model.addAttribute("userName", userName);
	}

}
